#ifndef __Drv_W2812__H
#define __Drv_W2812__H

#include "Drv_Sys.h"

// void Drv_LED_Init(void);

#define WS2812_PIN GPIO_Pin_8
#define WS2812_PORT GPIOA
#define WS2812_TIMER TIM1
#define WS2812_GPIO_RCC RCC_APB2Periph_GPIOA
#define WS2812_DMA_RCC RCC_AHBPeriph_DMA1
#define WS2812_TIMER_RCC RCC_APB2Periph_TIM1
#define WS2812_DMA_CHAN DMA1_Channel2

#define RED 0
#define GREEN 1
#define BULE 2

#define ONE 40
#define ZERO 19
#define WS2812_LEDNUM 4
#define WS2812_BUFF_LEN WS2812_LEDNUM * 24 + 60

extern uint16_t WS2812_Buff[WS2812_BUFF_LEN];

void DrvWs2812Init(void);
void DrvWs2812Updata(u8 (*color)[3], u16 len);

#endif
